{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import requests\n",
    "import json\n",
    "import demjson\n",
    "from jsonpath import jsonpath"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_info(isOnline,year,month):\n",
    "    url = 'https://wechatapi.monitor.com.cn/api/services/app/MarketRead/MarketReadBulletin'\n",
    "    data = {'category':'',\n",
    "            'categories':[],\n",
    "            'isOnline':isOnline,\n",
    "            'year':year,\n",
    "            'month':month,\n",
    "            'isWeekYear':False}\n",
    "    headers = {\n",
    "    #            'Host': 'wechatapi.monitor.com.cn',\n",
    "    #            'Connection': 'keep-alive',\n",
    "    #            'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 MicroMessenger/7.0.9.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat',\n",
    "               'content-type': 'application/json;charset=utf-8',\n",
    "    #            'Referer': 'https://servicewechat.com/wxca2c15072ee86758/26/page-frame.html'\n",
    "               }\n",
    "    res = requests.post(url,data=json.dumps(data),headers=headers)\n",
    "    json_data = demjson.decode(res.text)\n",
    "    classify_list = jsonpath(json_data, '$..classify')\n",
    "    groupName_list = jsonpath(json_data, '$..groupName')\n",
    "    category_list = jsonpath(json_data, '$..category')\n",
    "    val_list = jsonpath(json_data, '$..val')\n",
    "    vol_list = jsonpath(json_data, '$..vol')\n",
    "    tqVal_list = jsonpath(json_data, '$..tqVal')\n",
    "    tqVol_list = jsonpath(json_data, '$..tqVol')\n",
    "    sqTVal = jsonpath(json_data, '$..sqVal')\n",
    "    sqTVol = jsonpath(json_data, '$..sqVol')\n",
    "    valTb = jsonpath(json_data, '$..valTb')\n",
    "    valHb = jsonpath(json_data, '$..valHb')\n",
    "    volTb = jsonpath(json_data, '$..volTb')\n",
    "    volHb = jsonpath(json_data, '$..volHb')\n",
    "    list_content = [groupName_list,category_list,val_list,vol_list,tqVal_list,tqVol_list,sqTVal,sqTVol,valTb,valHb,volTb,volHb]\n",
    "    df_jsonpath = pd.DataFrame(list_content)\n",
    "    df_jsonpath = df_jsonpath.T\n",
    "    df_jsonpath.rename(columns={\n",
    "                                0:'中分类',\n",
    "                                1:'细分类',\n",
    "                                2:'本期销售额(万)',\n",
    "                                3:'本期销售量(万)',\n",
    "                                4:'同期销售额(万)',\n",
    "                                5:'同期销售量(万)',\n",
    "                                6:'上期销售额(万)',\n",
    "                                7:'上期销售量(万)',\n",
    "                                8:'零售额同比',\n",
    "                                9:'零售额环比',\n",
    "                                10:'零售量同比',\n",
    "                                11:'零售量环比',\n",
    "                                },inplace=True)\n",
    "    df_jsonpath['零售量同比'] = df_jsonpath['零售量同比'].apply(lambda x:str(round(float(x) * 100,2)) + '%')\n",
    "    df_jsonpath['零售量环比'] = df_jsonpath['零售量环比'].apply(lambda x:str(round(float(x) * 100,2)) + '%')\n",
    "    df_jsonpath['零售额同比'] = df_jsonpath['零售额同比'].apply(lambda x:str(round(float(x) * 100,2)) + '%')\n",
    "    df_jsonpath['零售额环比'] = df_jsonpath['零售额环比'].apply(lambda x:str(round(float(x) * 100,2)) + '%')\n",
    "    df_jsonpath['本期销售额(万)'] = df_jsonpath['本期销售额(万)'].apply(lambda x:round(x / 10000,2))\n",
    "    df_jsonpath['本期销售量(万)'] = df_jsonpath['本期销售量(万)'].apply(lambda x:round(x / 10000,2))\n",
    "    df_jsonpath['同期销售额(万)'] = df_jsonpath['同期销售额(万)'].apply(lambda x:round(x / 10000,2))\n",
    "    df_jsonpath['同期销售量(万)'] = df_jsonpath['同期销售量(万)'].apply(lambda x:round(x / 10000,2))\n",
    "    df_jsonpath['上期销售额(万)'] = df_jsonpath['上期销售额(万)'].apply(lambda x:round(x / 10000,2))\n",
    "    df_jsonpath['上期销售量(万)'] = df_jsonpath['上期销售量(万)'].apply(lambda x:round(x / 10000,2))\n",
    "    return df_jsonpath.sort_values(by=['中分类','细分类'],ascending=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>中分类</th>\n",
       "      <th>细分类</th>\n",
       "      <th>本期销售额(万)</th>\n",
       "      <th>本期销售量(万)</th>\n",
       "      <th>同期销售额(万)</th>\n",
       "      <th>同期销售量(万)</th>\n",
       "      <th>上期销售额(万)</th>\n",
       "      <th>上期销售量(万)</th>\n",
       "      <th>零售额同比</th>\n",
       "      <th>零售额环比</th>\n",
       "      <th>零售量同比</th>\n",
       "      <th>零售量环比</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>13</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>净水设备</td>\n",
       "      <td>33456.32</td>\n",
       "      <td>38.59</td>\n",
       "      <td>36244.88</td>\n",
       "      <td>53.69</td>\n",
       "      <td>66448.95</td>\n",
       "      <td>64.64</td>\n",
       "      <td>-7.74%</td>\n",
       "      <td>-49.65%</td>\n",
       "      <td>-28.13%</td>\n",
       "      <td>-40.31%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>17</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>台式微波炉</td>\n",
       "      <td>26123.67</td>\n",
       "      <td>63.17</td>\n",
       "      <td>26924.40</td>\n",
       "      <td>62.09</td>\n",
       "      <td>51427.25</td>\n",
       "      <td>126.95</td>\n",
       "      <td>-2.97%</td>\n",
       "      <td>-49.2%</td>\n",
       "      <td>1.73%</td>\n",
       "      <td>-50.25%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>14</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>台式电烤箱</td>\n",
       "      <td>14057.15</td>\n",
       "      <td>35.43</td>\n",
       "      <td>31094.98</td>\n",
       "      <td>92.52</td>\n",
       "      <td>29085.03</td>\n",
       "      <td>79.99</td>\n",
       "      <td>-54.79%</td>\n",
       "      <td>-51.67%</td>\n",
       "      <td>-61.71%</td>\n",
       "      <td>-55.71%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>11</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>壁挂炉</td>\n",
       "      <td>1957.40</td>\n",
       "      <td>0.33</td>\n",
       "      <td>550.76</td>\n",
       "      <td>0.09</td>\n",
       "      <td>3824.89</td>\n",
       "      <td>0.59</td>\n",
       "      <td>254.58%</td>\n",
       "      <td>-48.82%</td>\n",
       "      <td>255.6%</td>\n",
       "      <td>-43.45%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>8</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>嵌入式一体机</td>\n",
       "      <td>3124.68</td>\n",
       "      <td>0.65</td>\n",
       "      <td>2560.56</td>\n",
       "      <td>0.61</td>\n",
       "      <td>9483.66</td>\n",
       "      <td>2.04</td>\n",
       "      <td>22.03%</td>\n",
       "      <td>-67.05%</td>\n",
       "      <td>7.33%</td>\n",
       "      <td>-68.1%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>9</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>嵌入式厨电</td>\n",
       "      <td>4260.91</td>\n",
       "      <td>0.93</td>\n",
       "      <td>3770.07</td>\n",
       "      <td>0.91</td>\n",
       "      <td>12774.92</td>\n",
       "      <td>2.86</td>\n",
       "      <td>12.82%</td>\n",
       "      <td>-66.65%</td>\n",
       "      <td>1.9%</td>\n",
       "      <td>-67.64%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>19</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>嵌入式微波炉</td>\n",
       "      <td>143.56</td>\n",
       "      <td>0.06</td>\n",
       "      <td>76.00</td>\n",
       "      <td>0.03</td>\n",
       "      <td>444.97</td>\n",
       "      <td>0.19</td>\n",
       "      <td>88.89%</td>\n",
       "      <td>-67.74%</td>\n",
       "      <td>112.62%</td>\n",
       "      <td>-66.74%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>16</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>嵌入式电烤箱</td>\n",
       "      <td>3686.13</td>\n",
       "      <td>0.77</td>\n",
       "      <td>3178.76</td>\n",
       "      <td>0.76</td>\n",
       "      <td>11114.54</td>\n",
       "      <td>2.41</td>\n",
       "      <td>15.96%</td>\n",
       "      <td>-66.84%</td>\n",
       "      <td>1.36%</td>\n",
       "      <td>-68.07%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>15</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>嵌入式蒸汽炉</td>\n",
       "      <td>431.22</td>\n",
       "      <td>0.09</td>\n",
       "      <td>515.31</td>\n",
       "      <td>0.12</td>\n",
       "      <td>1215.41</td>\n",
       "      <td>0.27</td>\n",
       "      <td>-17.79%</td>\n",
       "      <td>-64.52%</td>\n",
       "      <td>-22.38%</td>\n",
       "      <td>-64.48%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>油烟机</td>\n",
       "      <td>33394.62</td>\n",
       "      <td>26.72</td>\n",
       "      <td>23415.84</td>\n",
       "      <td>20.49</td>\n",
       "      <td>96465.35</td>\n",
       "      <td>69.93</td>\n",
       "      <td>42.61%</td>\n",
       "      <td>-65.38%</td>\n",
       "      <td>30.36%</td>\n",
       "      <td>-61.79%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>10</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>洗碗机</td>\n",
       "      <td>11057.79</td>\n",
       "      <td>3.34</td>\n",
       "      <td>15006.99</td>\n",
       "      <td>5.07</td>\n",
       "      <td>25905.01</td>\n",
       "      <td>6.68</td>\n",
       "      <td>-26.32%</td>\n",
       "      <td>-57.31%</td>\n",
       "      <td>-34.12%</td>\n",
       "      <td>-50.03%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>18</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>消毒柜</td>\n",
       "      <td>8118.37</td>\n",
       "      <td>11.50</td>\n",
       "      <td>11623.02</td>\n",
       "      <td>17.37</td>\n",
       "      <td>18659.00</td>\n",
       "      <td>24.42</td>\n",
       "      <td>-30.16%</td>\n",
       "      <td>-56.49%</td>\n",
       "      <td>-33.77%</td>\n",
       "      <td>-52.9%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>20</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>热水器</td>\n",
       "      <td>74557.29</td>\n",
       "      <td>71.04</td>\n",
       "      <td>62939.05</td>\n",
       "      <td>66.43</td>\n",
       "      <td>219989.77</td>\n",
       "      <td>202.02</td>\n",
       "      <td>18.46%</td>\n",
       "      <td>-66.11%</td>\n",
       "      <td>6.95%</td>\n",
       "      <td>-64.84%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>7</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>燃气灶</td>\n",
       "      <td>25295.29</td>\n",
       "      <td>39.11</td>\n",
       "      <td>17178.34</td>\n",
       "      <td>31.90</td>\n",
       "      <td>70158.90</td>\n",
       "      <td>96.72</td>\n",
       "      <td>47.25%</td>\n",
       "      <td>-63.95%</td>\n",
       "      <td>22.61%</td>\n",
       "      <td>-59.56%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>6</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>集成灶</td>\n",
       "      <td>7010.32</td>\n",
       "      <td>1.15</td>\n",
       "      <td>6390.38</td>\n",
       "      <td>1.13</td>\n",
       "      <td>26706.62</td>\n",
       "      <td>3.98</td>\n",
       "      <td>9.66%</td>\n",
       "      <td>-73.75%</td>\n",
       "      <td>1.54%</td>\n",
       "      <td>-71.12%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>12</td>\n",
       "      <td>厨卫</td>\n",
       "      <td>饮水设备</td>\n",
       "      <td>13467.23</td>\n",
       "      <td>39.92</td>\n",
       "      <td>12021.50</td>\n",
       "      <td>34.01</td>\n",
       "      <td>23816.99</td>\n",
       "      <td>71.05</td>\n",
       "      <td>12.02%</td>\n",
       "      <td>-43.46%</td>\n",
       "      <td>17.39%</td>\n",
       "      <td>-43.81%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>33</td>\n",
       "      <td>厨房水料</td>\n",
       "      <td>厨师机</td>\n",
       "      <td>2476.52</td>\n",
       "      <td>2.09</td>\n",
       "      <td>4604.15</td>\n",
       "      <td>4.68</td>\n",
       "      <td>5225.36</td>\n",
       "      <td>4.30</td>\n",
       "      <td>-46.21%</td>\n",
       "      <td>-52.61%</td>\n",
       "      <td>-55.35%</td>\n",
       "      <td>-51.42%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>26</td>\n",
       "      <td>厨房水料</td>\n",
       "      <td>搅拌机</td>\n",
       "      <td>761.41</td>\n",
       "      <td>7.36</td>\n",
       "      <td>1599.23</td>\n",
       "      <td>15.23</td>\n",
       "      <td>986.92</td>\n",
       "      <td>9.80</td>\n",
       "      <td>-52.39%</td>\n",
       "      <td>-22.85%</td>\n",
       "      <td>-51.71%</td>\n",
       "      <td>-24.92%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>31</td>\n",
       "      <td>厨房水料</td>\n",
       "      <td>榨汁机</td>\n",
       "      <td>2567.95</td>\n",
       "      <td>3.90</td>\n",
       "      <td>1905.31</td>\n",
       "      <td>3.46</td>\n",
       "      <td>3620.78</td>\n",
       "      <td>5.26</td>\n",
       "      <td>34.78%</td>\n",
       "      <td>-29.08%</td>\n",
       "      <td>12.54%</td>\n",
       "      <td>-25.84%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>35</td>\n",
       "      <td>厨房水料</td>\n",
       "      <td>煮水系列</td>\n",
       "      <td>30522.58</td>\n",
       "      <td>244.57</td>\n",
       "      <td>29770.52</td>\n",
       "      <td>246.31</td>\n",
       "      <td>54631.97</td>\n",
       "      <td>440.39</td>\n",
       "      <td>2.53%</td>\n",
       "      <td>-44.13%</td>\n",
       "      <td>-0.71%</td>\n",
       "      <td>-44.47%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>34</td>\n",
       "      <td>厨房水料</td>\n",
       "      <td>电咖啡机</td>\n",
       "      <td>5050.97</td>\n",
       "      <td>4.34</td>\n",
       "      <td>6866.91</td>\n",
       "      <td>7.10</td>\n",
       "      <td>10867.93</td>\n",
       "      <td>8.73</td>\n",
       "      <td>-26.46%</td>\n",
       "      <td>-53.52%</td>\n",
       "      <td>-38.89%</td>\n",
       "      <td>-50.25%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>32</td>\n",
       "      <td>厨房水料</td>\n",
       "      <td>破壁料理机</td>\n",
       "      <td>17157.87</td>\n",
       "      <td>32.68</td>\n",
       "      <td>34609.44</td>\n",
       "      <td>50.31</td>\n",
       "      <td>32707.06</td>\n",
       "      <td>66.23</td>\n",
       "      <td>-50.42%</td>\n",
       "      <td>-47.54%</td>\n",
       "      <td>-35.05%</td>\n",
       "      <td>-50.66%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>36</td>\n",
       "      <td>厨房水料</td>\n",
       "      <td>豆浆机</td>\n",
       "      <td>7003.07</td>\n",
       "      <td>19.20</td>\n",
       "      <td>9000.32</td>\n",
       "      <td>22.37</td>\n",
       "      <td>11191.03</td>\n",
       "      <td>30.79</td>\n",
       "      <td>-22.19%</td>\n",
       "      <td>-37.42%</td>\n",
       "      <td>-14.16%</td>\n",
       "      <td>-37.62%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>37</td>\n",
       "      <td>厨房烹饪</td>\n",
       "      <td>压力锅</td>\n",
       "      <td>17460.17</td>\n",
       "      <td>52.75</td>\n",
       "      <td>17864.10</td>\n",
       "      <td>58.12</td>\n",
       "      <td>37218.36</td>\n",
       "      <td>108.88</td>\n",
       "      <td>-2.26%</td>\n",
       "      <td>-53.09%</td>\n",
       "      <td>-9.23%</td>\n",
       "      <td>-51.55%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>40</td>\n",
       "      <td>厨房烹饪</td>\n",
       "      <td>电炖锅</td>\n",
       "      <td>4758.20</td>\n",
       "      <td>30.48</td>\n",
       "      <td>3876.89</td>\n",
       "      <td>25.25</td>\n",
       "      <td>8999.80</td>\n",
       "      <td>54.66</td>\n",
       "      <td>22.67%</td>\n",
       "      <td>-47.13%</td>\n",
       "      <td>20.7%</td>\n",
       "      <td>-44.24%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>38</td>\n",
       "      <td>厨房烹饪</td>\n",
       "      <td>电磁炉</td>\n",
       "      <td>10877.38</td>\n",
       "      <td>54.71</td>\n",
       "      <td>16696.34</td>\n",
       "      <td>85.48</td>\n",
       "      <td>22299.76</td>\n",
       "      <td>108.79</td>\n",
       "      <td>-34.85%</td>\n",
       "      <td>-51.22%</td>\n",
       "      <td>-36.0%</td>\n",
       "      <td>-49.71%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>21</td>\n",
       "      <td>厨房烹饪</td>\n",
       "      <td>电饭煲</td>\n",
       "      <td>33990.75</td>\n",
       "      <td>138.08</td>\n",
       "      <td>40075.05</td>\n",
       "      <td>175.77</td>\n",
       "      <td>64258.58</td>\n",
       "      <td>251.41</td>\n",
       "      <td>-15.18%</td>\n",
       "      <td>-47.1%</td>\n",
       "      <td>-21.44%</td>\n",
       "      <td>-45.08%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>23</td>\n",
       "      <td>厨房烹饪</td>\n",
       "      <td>电饼铛</td>\n",
       "      <td>5925.85</td>\n",
       "      <td>33.49</td>\n",
       "      <td>14758.32</td>\n",
       "      <td>86.98</td>\n",
       "      <td>13083.53</td>\n",
       "      <td>71.72</td>\n",
       "      <td>-59.85%</td>\n",
       "      <td>-54.71%</td>\n",
       "      <td>-61.5%</td>\n",
       "      <td>-53.31%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>24</td>\n",
       "      <td>家居护理</td>\n",
       "      <td>吸尘器</td>\n",
       "      <td>93368.18</td>\n",
       "      <td>111.52</td>\n",
       "      <td>100621.50</td>\n",
       "      <td>121.04</td>\n",
       "      <td>148506.48</td>\n",
       "      <td>180.76</td>\n",
       "      <td>-7.21%</td>\n",
       "      <td>-37.13%</td>\n",
       "      <td>-7.86%</td>\n",
       "      <td>-38.3%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>30</td>\n",
       "      <td>家居护理</td>\n",
       "      <td>挂烫机</td>\n",
       "      <td>9266.12</td>\n",
       "      <td>47.19</td>\n",
       "      <td>8323.73</td>\n",
       "      <td>45.77</td>\n",
       "      <td>10480.46</td>\n",
       "      <td>52.13</td>\n",
       "      <td>11.31%</td>\n",
       "      <td>-11.59%</td>\n",
       "      <td>3.08%</td>\n",
       "      <td>-9.48%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>27</td>\n",
       "      <td>家居护理</td>\n",
       "      <td>蒸汽电熨斗</td>\n",
       "      <td>851.45</td>\n",
       "      <td>6.86</td>\n",
       "      <td>619.07</td>\n",
       "      <td>4.20</td>\n",
       "      <td>1277.49</td>\n",
       "      <td>9.22</td>\n",
       "      <td>37.53%</td>\n",
       "      <td>-33.35%</td>\n",
       "      <td>63.39%</td>\n",
       "      <td>-25.59%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>22</td>\n",
       "      <td>家居环境</td>\n",
       "      <td>加湿器</td>\n",
       "      <td>7576.60</td>\n",
       "      <td>39.45</td>\n",
       "      <td>7571.34</td>\n",
       "      <td>43.87</td>\n",
       "      <td>28521.49</td>\n",
       "      <td>168.01</td>\n",
       "      <td>0.07%</td>\n",
       "      <td>-73.44%</td>\n",
       "      <td>-10.08%</td>\n",
       "      <td>-76.52%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>29</td>\n",
       "      <td>家居环境</td>\n",
       "      <td>抽湿机</td>\n",
       "      <td>5550.93</td>\n",
       "      <td>6.38</td>\n",
       "      <td>14494.04</td>\n",
       "      <td>14.78</td>\n",
       "      <td>6887.03</td>\n",
       "      <td>7.80</td>\n",
       "      <td>-61.7%</td>\n",
       "      <td>-19.4%</td>\n",
       "      <td>-56.81%</td>\n",
       "      <td>-18.22%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>39</td>\n",
       "      <td>家居环境</td>\n",
       "      <td>电暖器</td>\n",
       "      <td>14347.13</td>\n",
       "      <td>51.62</td>\n",
       "      <td>12589.26</td>\n",
       "      <td>54.78</td>\n",
       "      <td>154563.80</td>\n",
       "      <td>595.52</td>\n",
       "      <td>13.96%</td>\n",
       "      <td>-90.72%</td>\n",
       "      <td>-5.78%</td>\n",
       "      <td>-91.33%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>25</td>\n",
       "      <td>家居环境</td>\n",
       "      <td>电风扇</td>\n",
       "      <td>2493.22</td>\n",
       "      <td>5.71</td>\n",
       "      <td>1988.34</td>\n",
       "      <td>0.35</td>\n",
       "      <td>2570.42</td>\n",
       "      <td>0.53</td>\n",
       "      <td>25.03%</td>\n",
       "      <td>-3.0%</td>\n",
       "      <td>1544.6%</td>\n",
       "      <td>985.87%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>28</td>\n",
       "      <td>家居环境</td>\n",
       "      <td>空气净化器</td>\n",
       "      <td>14084.12</td>\n",
       "      <td>8.90</td>\n",
       "      <td>28902.66</td>\n",
       "      <td>18.08</td>\n",
       "      <td>34441.95</td>\n",
       "      <td>21.01</td>\n",
       "      <td>-51.44%</td>\n",
       "      <td>-59.11%</td>\n",
       "      <td>-50.91%</td>\n",
       "      <td>-57.67%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>彩电</td>\n",
       "      <td>彩电</td>\n",
       "      <td>274144.32</td>\n",
       "      <td>109.37</td>\n",
       "      <td>182824.36</td>\n",
       "      <td>103.76</td>\n",
       "      <td>741328.97</td>\n",
       "      <td>283.15</td>\n",
       "      <td>49.95%</td>\n",
       "      <td>-63.02%</td>\n",
       "      <td>5.4%</td>\n",
       "      <td>-61.37%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>白电</td>\n",
       "      <td>冰柜</td>\n",
       "      <td>38197.41</td>\n",
       "      <td>34.01</td>\n",
       "      <td>12235.11</td>\n",
       "      <td>11.23</td>\n",
       "      <td>65746.92</td>\n",
       "      <td>62.62</td>\n",
       "      <td>212.12%</td>\n",
       "      <td>-41.9%</td>\n",
       "      <td>202.85%</td>\n",
       "      <td>-45.68%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>白电</td>\n",
       "      <td>冰箱</td>\n",
       "      <td>213412.66</td>\n",
       "      <td>98.57</td>\n",
       "      <td>112655.71</td>\n",
       "      <td>60.34</td>\n",
       "      <td>429669.28</td>\n",
       "      <td>170.23</td>\n",
       "      <td>89.43%</td>\n",
       "      <td>-50.33%</td>\n",
       "      <td>63.36%</td>\n",
       "      <td>-42.1%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>白电</td>\n",
       "      <td>洗衣机</td>\n",
       "      <td>189062.82</td>\n",
       "      <td>136.65</td>\n",
       "      <td>111447.37</td>\n",
       "      <td>80.77</td>\n",
       "      <td>401594.85</td>\n",
       "      <td>268.35</td>\n",
       "      <td>69.64%</td>\n",
       "      <td>-52.92%</td>\n",
       "      <td>69.18%</td>\n",
       "      <td>-49.08%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>空调</td>\n",
       "      <td>空调</td>\n",
       "      <td>143695.16</td>\n",
       "      <td>46.64</td>\n",
       "      <td>131251.90</td>\n",
       "      <td>53.28</td>\n",
       "      <td>301203.42</td>\n",
       "      <td>94.36</td>\n",
       "      <td>9.48%</td>\n",
       "      <td>-52.29%</td>\n",
       "      <td>-12.46%</td>\n",
       "      <td>-50.57%</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     中分类     细分类   本期销售额(万)  本期销售量(万)   同期销售额(万)  同期销售量(万)   上期销售额(万)  \\\n",
       "13    厨卫    净水设备   33456.32     38.59   36244.88     53.69   66448.95   \n",
       "17    厨卫   台式微波炉   26123.67     63.17   26924.40     62.09   51427.25   \n",
       "14    厨卫   台式电烤箱   14057.15     35.43   31094.98     92.52   29085.03   \n",
       "11    厨卫     壁挂炉    1957.40      0.33     550.76      0.09    3824.89   \n",
       "8     厨卫  嵌入式一体机    3124.68      0.65    2560.56      0.61    9483.66   \n",
       "9     厨卫   嵌入式厨电    4260.91      0.93    3770.07      0.91   12774.92   \n",
       "19    厨卫  嵌入式微波炉     143.56      0.06      76.00      0.03     444.97   \n",
       "16    厨卫  嵌入式电烤箱    3686.13      0.77    3178.76      0.76   11114.54   \n",
       "15    厨卫  嵌入式蒸汽炉     431.22      0.09     515.31      0.12    1215.41   \n",
       "5     厨卫     油烟机   33394.62     26.72   23415.84     20.49   96465.35   \n",
       "10    厨卫     洗碗机   11057.79      3.34   15006.99      5.07   25905.01   \n",
       "18    厨卫     消毒柜    8118.37     11.50   11623.02     17.37   18659.00   \n",
       "20    厨卫     热水器   74557.29     71.04   62939.05     66.43  219989.77   \n",
       "7     厨卫     燃气灶   25295.29     39.11   17178.34     31.90   70158.90   \n",
       "6     厨卫     集成灶    7010.32      1.15    6390.38      1.13   26706.62   \n",
       "12    厨卫    饮水设备   13467.23     39.92   12021.50     34.01   23816.99   \n",
       "33  厨房水料     厨师机    2476.52      2.09    4604.15      4.68    5225.36   \n",
       "26  厨房水料     搅拌机     761.41      7.36    1599.23     15.23     986.92   \n",
       "31  厨房水料     榨汁机    2567.95      3.90    1905.31      3.46    3620.78   \n",
       "35  厨房水料    煮水系列   30522.58    244.57   29770.52    246.31   54631.97   \n",
       "34  厨房水料    电咖啡机    5050.97      4.34    6866.91      7.10   10867.93   \n",
       "32  厨房水料   破壁料理机   17157.87     32.68   34609.44     50.31   32707.06   \n",
       "36  厨房水料     豆浆机    7003.07     19.20    9000.32     22.37   11191.03   \n",
       "37  厨房烹饪     压力锅   17460.17     52.75   17864.10     58.12   37218.36   \n",
       "40  厨房烹饪     电炖锅    4758.20     30.48    3876.89     25.25    8999.80   \n",
       "38  厨房烹饪     电磁炉   10877.38     54.71   16696.34     85.48   22299.76   \n",
       "21  厨房烹饪     电饭煲   33990.75    138.08   40075.05    175.77   64258.58   \n",
       "23  厨房烹饪     电饼铛    5925.85     33.49   14758.32     86.98   13083.53   \n",
       "24  家居护理     吸尘器   93368.18    111.52  100621.50    121.04  148506.48   \n",
       "30  家居护理     挂烫机    9266.12     47.19    8323.73     45.77   10480.46   \n",
       "27  家居护理   蒸汽电熨斗     851.45      6.86     619.07      4.20    1277.49   \n",
       "22  家居环境     加湿器    7576.60     39.45    7571.34     43.87   28521.49   \n",
       "29  家居环境     抽湿机    5550.93      6.38   14494.04     14.78    6887.03   \n",
       "39  家居环境     电暖器   14347.13     51.62   12589.26     54.78  154563.80   \n",
       "25  家居环境     电风扇    2493.22      5.71    1988.34      0.35    2570.42   \n",
       "28  家居环境   空气净化器   14084.12      8.90   28902.66     18.08   34441.95   \n",
       "2     彩电      彩电  274144.32    109.37  182824.36    103.76  741328.97   \n",
       "0     白电      冰柜   38197.41     34.01   12235.11     11.23   65746.92   \n",
       "1     白电      冰箱  213412.66     98.57  112655.71     60.34  429669.28   \n",
       "3     白电     洗衣机  189062.82    136.65  111447.37     80.77  401594.85   \n",
       "4     空调      空调  143695.16     46.64  131251.90     53.28  301203.42   \n",
       "\n",
       "    上期销售量(万)    零售额同比    零售额环比    零售量同比    零售量环比  \n",
       "13     64.64   -7.74%  -49.65%  -28.13%  -40.31%  \n",
       "17    126.95   -2.97%   -49.2%    1.73%  -50.25%  \n",
       "14     79.99  -54.79%  -51.67%  -61.71%  -55.71%  \n",
       "11      0.59  254.58%  -48.82%   255.6%  -43.45%  \n",
       "8       2.04   22.03%  -67.05%    7.33%   -68.1%  \n",
       "9       2.86   12.82%  -66.65%     1.9%  -67.64%  \n",
       "19      0.19   88.89%  -67.74%  112.62%  -66.74%  \n",
       "16      2.41   15.96%  -66.84%    1.36%  -68.07%  \n",
       "15      0.27  -17.79%  -64.52%  -22.38%  -64.48%  \n",
       "5      69.93   42.61%  -65.38%   30.36%  -61.79%  \n",
       "10      6.68  -26.32%  -57.31%  -34.12%  -50.03%  \n",
       "18     24.42  -30.16%  -56.49%  -33.77%   -52.9%  \n",
       "20    202.02   18.46%  -66.11%    6.95%  -64.84%  \n",
       "7      96.72   47.25%  -63.95%   22.61%  -59.56%  \n",
       "6       3.98    9.66%  -73.75%    1.54%  -71.12%  \n",
       "12     71.05   12.02%  -43.46%   17.39%  -43.81%  \n",
       "33      4.30  -46.21%  -52.61%  -55.35%  -51.42%  \n",
       "26      9.80  -52.39%  -22.85%  -51.71%  -24.92%  \n",
       "31      5.26   34.78%  -29.08%   12.54%  -25.84%  \n",
       "35    440.39    2.53%  -44.13%   -0.71%  -44.47%  \n",
       "34      8.73  -26.46%  -53.52%  -38.89%  -50.25%  \n",
       "32     66.23  -50.42%  -47.54%  -35.05%  -50.66%  \n",
       "36     30.79  -22.19%  -37.42%  -14.16%  -37.62%  \n",
       "37    108.88   -2.26%  -53.09%   -9.23%  -51.55%  \n",
       "40     54.66   22.67%  -47.13%    20.7%  -44.24%  \n",
       "38    108.79  -34.85%  -51.22%   -36.0%  -49.71%  \n",
       "21    251.41  -15.18%   -47.1%  -21.44%  -45.08%  \n",
       "23     71.72  -59.85%  -54.71%   -61.5%  -53.31%  \n",
       "24    180.76   -7.21%  -37.13%   -7.86%   -38.3%  \n",
       "30     52.13   11.31%  -11.59%    3.08%   -9.48%  \n",
       "27      9.22   37.53%  -33.35%   63.39%  -25.59%  \n",
       "22    168.01    0.07%  -73.44%  -10.08%  -76.52%  \n",
       "29      7.80   -61.7%   -19.4%  -56.81%  -18.22%  \n",
       "39    595.52   13.96%  -90.72%   -5.78%  -91.33%  \n",
       "25      0.53   25.03%    -3.0%  1544.6%  985.87%  \n",
       "28     21.01  -51.44%  -59.11%  -50.91%  -57.67%  \n",
       "2     283.15   49.95%  -63.02%     5.4%  -61.37%  \n",
       "0      62.62  212.12%   -41.9%  202.85%  -45.68%  \n",
       "1     170.23   89.43%  -50.33%   63.36%   -42.1%  \n",
       "3     268.35   69.64%  -52.92%   69.18%  -49.08%  \n",
       "4      94.36    9.48%  -52.29%  -12.46%  -50.57%  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "isOnline = True # 是否线上\n",
    "year = '2021' # 年\n",
    "month ='2' # 月份\n",
    "week = '' # 周次\n",
    "df = get_info(isOnline,year,month)\n",
    "\n",
    "df"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
